package cc.dowell.pojo;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class History {
    @TableId(type = IdType.AUTO)
    private Long id;
    private int fruitId;
    private String varietyCode; //AI端返回的品种码
    private String imgPath;     //已完成检测的图片存储路径
    private int matureCount;
    private int totalCount;
    private int zoneId;

    private Long createUserId;

    //后台实体类LocalDateTime 添加注解，即可接收到值
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    //前端格式以"2020-05-09 10:55:22"这样的格式传值
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    //插入时，自动生成CreateTime
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;


}
